import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
	{ path: '/', name: 'login', component: () => import('@/views/login') },
	{ path: '', name: 'login', component: () => import('@/views/login') },
	{
		path: '/login',
		name: 'login',
		component: () => import('@/views/login'),
	},
	{
		path: '/index',
		name: 'index',
		component: () => import('@/views/layout'),
		children: [
			{
				path: '/',
				name: 'home',
				component: () => import('@/views/home'),
			},
			{
				path: '/artcate',
				name: 'artcate',
				component: () => import('@/views/article/articleCate'),
			},
			{
				path: '/artlist',
				name: 'artlist',
				component: () => import('@/views/article/articleList'),
			},
			{
				path: '/userinfo',
				name: 'userinfo',
				component: () => import('@/views/user/userinfo'),
			},
			{
				path: '/userAvatar',
				name: 'userAvatar',
				component: () => import('@/views/user/userAvatar'),
			},
			{
				path: '/userPwd',
				name: 'userPwd',
				component: () => import('@/views/user/userPwd'),
			},
		],
	},
]
const router = new VueRouter({
	routes,
})

export default router
